package com.blueheart.music.mapper;

import com.blueheart.music.model.pojo.Collect;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;


import java.util.List;

@Mapper
@Repository
public interface CollectMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Collect record);

    int insertSelective(Collect record);

    Collect selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Collect record);

    int updateByPrimaryKey(Collect record);

    /**
     * 查询全部收藏
     * @return
     */
    List<Collect> selectAll();

    /**
     * 通过id查询个人收藏
     * @param userId
     * @return
     */
    List<Collect> selectByUserId(Integer userId);

    /**
     * 检查该用户是否有该歌曲
     * @param userId
     * @param songId
     * @return
     */
    Collect checkSongInUser(Integer userId,Integer songId);

    /**
     * 检查该用户是否有该歌单
     * @param userId
     * @param songListId
     * @return
     */
    Collect checkSongListInUser(Integer userId,Integer songListId);
}